package com.zx;

import org.springframework.retry.annotation.Backoff;
import org.springframework.retry.annotation.Retryable;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class DemoService {

    @Retryable(value = Exception.class,maxAttempts = 3,backoff = @Backoff(delay = 2000,multiplier = 1.5))
    public void runSpringRetry() throws Exception {
        System.out.println("开始业务处理...." + new Date());
        throw new Exception("spring retry fail");
    }
}
